<template>
  	<div class="nav">
	  		<router-link to="/myCourse" class="myCourse">
	  			<span class=""></span>
	  			<b>我的课程</b>
	  		</router-link>
	  		<router-link to="/myCollect" class="myCollect">
	  			<span class=""></span>
	  			<b>视频收藏</b>
	  		</router-link>
	  		<!-- <router-link to="/myDown" class="myDown">
	  			<span class=""></span>
	  			<b>我的下载</b>
	  		</router-link> -->
	  		<router-link to="/dailyProblem" class="dailyProblem">
	  			<span class=""></span>
	  			<b>点滴积累</b>
	  		</router-link>
	</div>
  </div>
</template>
<script>
    export default {
        data() {
            return {
                userid: '',
                usertype: "", // 判断用户是否通过医师认证 如果通过就是doctor
            }
        },
        methods: {
            justUserType() {  //判断用户是否通过医生认证
                this.userid = localStorage.getItem("loginMobile");
                if(this.userid) {
                    this.$api.get(this.$api.baseURLSchool,"select_cid/user/"+this.userid,{},r => {
                        // console.log(r);
                        if(r.data.ret == 1) {
                            if(r.data.info.per_app_status=="1") {
                                this.usertype = "doctor";
                            } 
                        }
                    },err => {
                        console.log(err);
                    })
                }
                
            },
            //点滴积累 只有医生能做
            goDailyProblem() {
                //判断用户是否认证 如果认证审核通过
                if(this.usertype == 'doctor') {
                    this.$router.push({name:'dailyProblem'});
                } else {
                    this.$router.push({name:'authentication'});
                }
            },
            
        },
        created() {
            this.justUserType();
        }
    }
</script>
<style lang="scss">
</style>